/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chameleon.view.command;

import chameleon.model.AbstractManager;
import chameleon.view.input.Input;

/**
 *
 * @author simon
 */
public class SolveGameCmd extends Command  {

    public SolveGameCmd(Input facade, boolean help){
        super(facade,false, help);
    }

    @Override
    public Input execute() {
        if (!help_){
            InternalCheckCommand check = new InternalCheckCommand(input_, 2);
            if (check.isOk()){
                AbstractManager manager = input_.getManager();
                if(manager == null)
                    outputManager_.displayString("Please use build_model before!\n");
                else
                    manager.solveGame();
                outputManager_.displayString("\n");
            }
        }
        else{
            outputManager_.displayString("resolve_game takes no parameters\n"
                    + "this command calls the game solver selected by the command"
                    + "read_model for resolve the game");
        }
        return input_;
    }

}
